package zhu.areas.match.dao;

import java.io.File;
import java.io.FileInputStream;
import java.sql.Blob;
import java.util.List;

import zhu.areas.match.data.AttendList;
import zhu.areas.match.data.Sponsor;
import zhu.common.dao.BaseDAOImpl;
import org.springframework.orm.hibernate3.SessionFactoryUtils;

public class AttendListDAOImpl extends BaseDAOImpl implements IAttendListDAO {
	
	public void saveAttendList(AttendList attendList) {			
		super.saveOrUpdate(attendList);		
	}

	public AttendList findAttendListById(int id) {
		
		return (AttendList) super.findById(AttendList.class, id);
	}

	public List<AttendList> findAllAttendList() {
				return (List<AttendList>)super.find("from AttendList");
	}

	public void deleteAttendList(AttendList attendList){
		super.delete(attendList);
	}
	public List<AttendList> findByUserAndCompId(int userId, int compId) {
		return (List<AttendList>)super.find("from AttendList where attender.userID="+userId+" and compApp.compID="+compId);
	}
}
